<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head th:replace="common/admin-header::header">
    <title>测试用例集</title>
</head>

<body class="app sidebar-mini rtl">
<div th:replace="common/admin-sadbar::sadbar"></div>
<div th:replace="common/modal/task-modal::task_add_modal"></div>

<main class="app-content">
    <div class="app-title">
        <div>
            <h1><i class="fa fa-lg fa-clock-o"></i> 定时任务</h1>
            <p>测试任务列表</p>
        </div>
        <ul class="app-breadcrumb breadcrumb">
            <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
            <li class="breadcrumb-item"><a href="#">定时任务列表</a></li>
        </ul>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="tile">
                <div class="tile-body">
                    <h3>任务列表</h3>
                    <div class="offset-md-9">
                        <button class="btn btn-primary" data-toggle="modal"
                                data-target="#task_add_modal" onclick="add_task_modal_show()"><i class="fa fa-plus"
                                                                                                 aria-hidden="true"></i>新增任务
                        </button>
                        <button class="btn btn-primary" onclick="" data-toggle="modal"
                                data-target="#"><i class="fa fa-plus" aria-hidden="true"></i>了解Cron表达式
                        </button>
                    </div>

                    <hr>
                    <table class="table table-hover table-hover" style="white-space: nowrap" id="sampleTable">
                        <thead>
                        <tr>
                            <th th:class="text-center">编号</th>
                            <th th:class="text-center">名称</th>
                            <th th:class="text-center">描述</th>
                            <th th:class="text-center">创建时间</th>
                            <th th:class="text-center">Cron表达式</th>
                            <th th:class="text-center">测试内容</th>
                            <th th:class="text-center">状态</th>
                            <th th:class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="task:${tasks}">
                            <td class="text-center" th:text="${task.getTaskId()}"></td>
                            <td class="text-center" th:text="${task.getTaskName()}"></td>
                            <td th:text="${task.getDescription()}"></td>
                            <td class="text-center" th:text="${task.getCreateTime()}"></td>
                            <td class="text-center" th:text="${task.getCronExpression()}"></td>
                            <td class="text-center" th:text="${task.getRunWith()}"></td>
                            <td class="text-center" th:text="${task.getStatus()}"></td>
                            <td>
                                <button class="btn btn-sm btn-primary">
                                    <i class="fa fa-play" aria-hidden="true"></i>立即运行
                                </button>
                                <button class="btn btn-sm btn-danger"
                                        data-toggle="modal" data-target="#testsuit_update_modal"><i class="fa fa-edit"
                                                                                                    aria-hidden="true"></i>停止
                                </button>
                                <button class="btn btn-sm btn-info"
                                        data-toggle="modal" data-target="#testsuit_update_modal"><i class="fa fa-edit"
                                                                                                    aria-hidden="true"></i>修改
                                </button>
                                <button class="btn btn-sm btn-danger"><i
                                        class="fa fa-remove"
                                        aria-hidden="true"></i>删除
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</main>

<div th:include="common/script::script"></div>
<script th:src="@{/static/flytest-js/util.js}"></script>
<script th:src="@{/static/flytest-js/task.js}"></script>
<script th:src="@{/static/valires/js/plugins/fakeLoader.js}"></script>
<script src="https://cdn.bootcss.com/bootstrap-filestyle/2.0.0/bootstrap-filestyle.js"></script>

<script type="text/javascript">
    drawDataTable("#sampleTable")
</script>

</body>
</html>